import request from '@/utils/request'
import store from '@/store'
// 查询generalUserImport列表
export function listgeneralUserImport(query) {
return request({
url: '/api/v1/generalUserImportList',
method: 'get',
params: query
}).then(function (res) {
        
    let boolOptions = store.getters.parameter.sys_bool; 
    res.data.list.forEach((item, index) => {
        // console.log(item)
        for (let key in item) {
            // console.log(key + '---' + item[key])
            if (key == "isActivated") {
                item[key] = getDictLabelByValue(item[key],boolOptions)
            }
             
        }
         
        res.data.list[index] = item
    });
    // console.log(res.data.list)
    return res;

})
}

function getDictLabelByValue(value,dict_list){
    let dictLabel="";
    dict_list.forEach((_item,index)=>{
        if(_item.dictValue==value){
            dictLabel= _item.dictLabel
        }
    })
    return dictLabel;
}

// 查询generalUserImport详细
export function getgeneralUserImport (id) {
return request({
url: '/api/v1/generalUserImport/' + id,
method: 'get'
})
}


// 新增generalUserImport
export function addgeneralUserImport(data) {
return request({
url: '/api/v1/generalUserImport',
method: 'post',
data: data
})
}

// 修改generalUserImport
export function updategeneralUserImport(data) {
return request({
url: '/api/v1/generalUserImport',
method: 'put',
data: data
})
}

// 删除generalUserImport
export function delgeneralUserImport(id) {
return request({
url: '/api/v1/generalUserImport/' + id,
method: 'delete'
})
}